package com.music.service.impl;

import com.music.common.BaseResult;
import com.music.dao.CmMusicianRepository;
import com.music.dao.CmUserDaoMapper;
import com.music.entity.CmMusician;
import com.music.entity.CmUser;
import com.music.service.CmMusicianService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 2 * @Author: 刘佳乐 :面向百度编程
 * 3 * @Date: 2020/12/13 15:48
 * 4
 */
@Service
public class CmMusicianServiceImpl implements CmMusicianService {

    @Autowired
    private CmMusicianRepository cmMusicianRepository;

    @Override
    public BaseResult findAll() {
        BaseResult baseResult = new BaseResult();
        List<CmMusician> all = cmMusicianRepository.findAll();
        if(all!=null){
            baseResult.setData(all);
            baseResult.setCode(200);
            baseResult.setMessage("查询成功");
            return baseResult;
        }
        baseResult.setCode(201);
        baseResult.setMessage("查询失败");
        return baseResult;
    }
}
